package com.challenge.smsservice.admin.service.impl;

import com.challenge.smsbase.Service.impl.GenericManagerImpl;
import com.challenge.smsdao.admin.dao.UserDao;
import com.challenge.smsdao.admin.domain.User;
import com.challenge.smsservice.admin.service.UserManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.transaction.Transactional;

/**
 * @author cuimingyang
 */
@Component
@Transactional
public class UserManagerImpl extends GenericManagerImpl<User,Long> implements UserManager {
    UserDao userDao;

    /**
     * setUserDao
     * @param userDao
     */
    @Autowired
    public void setUserDao(UserDao userDao){
        this.userDao = userDao;
        this.dao = this.userDao;
    }

    /**
     * findByName
     * @param username
     * @return
     */

    @Override
    public User findByName(String username) {
        return userDao.findByName(username);
    }
}
